import Book.BookList;
import user.AdminUser;
import user.NormalUSer;
import user.User;

import java.util.Scanner;

public class text {


    public static User login(){
        System.out.println("请输入您的名字：");
        Scanner sca = new Scanner(System.in);
        String name = sca.nextLine();
        System.out.println("请输入您的身份：管理员：0");
        System.out.println("请输入您的身份：普通用户：1");
        int num = sca.nextInt();
        if(num == 0){
           return  new AdminUser(name);
        }else{
           return  new NormalUSer(name);
        }
    }
    public static void main(String[] args) {
        BookList booklist = new BookList();
        User user = login();
        while (true){
          int choice = user.menu();
          user.dowork(choice,booklist);
        }

    }
}
